.class public Lnet/oauth/SimpleOAuthValidator;
.super Ljava/lang/Object;
.source "SimpleOAuthValidator.java"

# interfaces
.implements Lnet/oauth/OAuthValidator;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lnet/oauth/SimpleOAuthValidator$UsedNonce;
    }
.end annotation


# static fields
.field public static final DEFAULT_MAX_TIMESTAMP_AGE:J = 0x493e0L

.field public static final DEFAULT_TIMESTAMP_WINDOW:J = 0x493e0L

.field public static final SINGLE_PARAMETERS:Ljava/util/Set;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Set",
            "<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field


# instance fields
.field protected final maxTimestampAgeMsec:J

.field protected final maxVersion:D

.field protected final minVersion:D

.field private final usedNonces:Ljava/util/Set;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Set",
            "<",
            "Lnet/oauth/SimpleOAuthValidator$UsedNonce;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 66
    invoke-static {}, Lnet/oauth/SimpleOAuthValidator;->constructSingleParameters()Ljava/util/Set;

    move-result-object v0

    sput-object v0, Lnet/oauth/SimpleOAuthValidator;->SINGLE_PARAMETERS:Ljava/util/Set;

    return-void
.end method

.method public constructor <init>()V
    .locals 4

    .prologue
    .line 83
    const-wide/32 v0, 0x493e0

    const-string v2, "1.0"

    invoke-static {v2}, Ljava/lang/Double;->parseDouble(Ljava/lang/String;)D

    move-result-wide v2

    invoke-direct {p0, v0, v1, v2, v3}, Lnet/oauth/SimpleOAuthValidator;-><init>(JD)V

    .line 84
    return-void
.end method

.method public constructor <init>(JD)V
    .locals 2
    .parameter "maxTimestampAgeMsec"
    .parameter "maxVersion"

    .prologue
    .line 96
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 101
    const-wide/high16 v0, 0x3ff0

    iput-wide v0, p0, Lnet/oauth/SimpleOAuthValidator;->minVersion:D

    .line 104
    new-instance v0, Ljava/util/TreeSet;

    invoke-direct {v0}, Ljava/util/TreeSet;-><init>()V

    iput-object v0, p0, Lnet/oauth/SimpleOAuthValidator;->usedNonces:Ljava/util/Set;

    .line 97
    iput-wide p1, p0, Lnet/oauth/SimpleOAuthValidator;->maxTimestampAgeMsec:J

    .line 98
    iput-wide p3, p0, Lnet/oauth/SimpleOAuthValidator;->maxVersion:D

    .line 99
    return-void
.end method

.method private static constructSingleParameters()Ljava/util/Set;
    .locals 7
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/Set",
            "<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation

    .prologue
    .line 69
    new-instance v4, Ljava/util/HashSet;

    invoke-direct {v4}, Ljava/util/HashSet;-><init>()V

    .line 70
    .local v4, s:Ljava/util/Set;,"Ljava/util/Set<Ljava/lang/String;>;"
    const/16 v5, 0x9

    new-array v0, v5, [Ljava/lang/String;

    const/4 v5, 0x0

    const-string v6, "oauth_consumer_key"

    aput-object v6, v0, v5

    const/4 v5, 0x1

    const-string v6, "oauth_token"

    aput-object v6, v0, v5

    const/4 v5, 0x2

    const-string v6, "oauth_token_secret"

    aput-object v6, v0, v5

    const/4 v5, 0x3

    const-string v6, "oauth_callback"

    aput-object v6, v0, v5

    const/4 v5, 0x4

    const-string v6, "oauth_signature_method"

    aput-object v6, v0, v5

    const/4 v5, 0x5

    const-string v6, "oauth_signature"

    aput-object v6, v0, v5

    const/4 v5, 0x6

    const-string v6, "oauth_timestamp"

    aput-object v6, v0, v5

    const/4 v5, 0x7

    const-string v6, "oauth_nonce"

    aput-object v6, v0, v5

    const/16 v5, 0x8

    const-string v6, "oauth_version"

    aput-object v6, v0, v5

    .local v0, arr$:[Ljava/lang/String;
    array-length v2, v0

    .local v2, len$:I
    const/4 v1, 0x0

    .local v1, i$:I
    :goto_0
    if-ge v1, v2, :cond_0

    aget-object v3, v0, v1

    .line 73
    .local v3, p:Ljava/lang/String;
    invoke-interface {v4, v3}, Ljava/util/Set;->add(Ljava/lang/Object;)Z

    .line 70
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 75
    .end local v3           #p:Ljava/lang/String;
    :cond_0
    invoke-static {v4}, Ljava/util/Collections;->unmodifiableSet(Ljava/util/Set;)Ljava/util/Set;

    move-result-object v5

    return-object v5
.end method

.method private removeOldNonces(J)Ljava/util/Date;
    .locals 11
    .parameter "currentTimeMsec"

    .prologue
    const-wide/16 v7, 0x3e8

    const-wide/16 v9, 0x1f4

    .line 122
    const/4 v2, 0x0

    .line 123
    .local v2, next:Lnet/oauth/SimpleOAuthValidator$UsedNonce;
    new-instance v1, Lnet/oauth/SimpleOAuthValidator$UsedNonce;

    iget-wide v4, p0, Lnet/oauth/SimpleOAuthValidator;->maxTimestampAgeMsec:J

    sub-long v4, p1, v4

    add-long/2addr v4, v9

    div-long/2addr v4, v7

    const/4 v6, 0x0

    new-array v6, v6, [Ljava/lang/String;

    invoke-direct {v1, v4, v5, v6}, Lnet/oauth/SimpleOAuthValidator$UsedNonce;-><init>(J[Ljava/lang/String;)V

    .line 124
    .local v1, min:Lnet/oauth/SimpleOAuthValidator$UsedNonce;
    iget-object v5, p0, Lnet/oauth/SimpleOAuthValidator;->usedNonces:Ljava/util/Set;

    monitor-enter v5

    .line 127
    :try_start_0
    iget-object v4, p0, Lnet/oauth/SimpleOAuthValidator;->usedNonces:Ljava/util/Set;

    invoke-interface {v4}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v0

    .local v0, iter:Ljava/util/Iterator;,"Ljava/util/Iterator<Lnet/oauth/SimpleOAuthValidator$UsedNonce;>;"
    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-eqz v4, :cond_0

    .line 128
    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lnet/oauth/SimpleOAuthValidator$UsedNonce;

    .line 129
    .local v3, used:Lnet/oauth/SimpleOAuthValidator$UsedNonce;
    invoke-virtual {v1, v3}, Lnet/oauth/SimpleOAuthValidator$UsedNonce;->compareTo(Lnet/oauth/SimpleOAuthValidator$UsedNonce;)I

    move-result v4

    if-gtz v4, :cond_1

    .line 130
    move-object v2, v3

    .line 135
    .end local v3           #used:Lnet/oauth/SimpleOAuthValidator$UsedNonce;
    :cond_0
    monitor-exit v5

    .line 136
    if-nez v2, :cond_2

    .line 137
    const/4 v4, 0x0

    .line 138
    :goto_1
    return-object v4

    .line 133
    .restart local v3       #used:Lnet/oauth/SimpleOAuthValidator$UsedNonce;
    :cond_1
    invoke-interface {v0}, Ljava/util/Iterator;->remove()V

    goto :goto_0

    .line 135
    .end local v0           #iter:Ljava/util/Iterator;,"Ljava/util/Iterator<Lnet/oauth/SimpleOAuthValidator$UsedNonce;>;"
    .end local v3           #used:Lnet/oauth/SimpleOAuthValidator$UsedNonce;
    :catchall_0
    move-exception v4

    monitor-exit v5
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v4

    .line 138
    .restart local v0       #iter:Ljava/util/Iterator;,"Ljava/util/Iterator<Lnet/oauth/SimpleOAuthValidator$UsedNonce;>;"
    :cond_2
    new-instance v4, Ljava/util/Date;

    invoke-virtual {v2}, Lnet/oauth/SimpleOAuthValidator$UsedNonce;->getTimestamp()J

    move-result-wide v5

    mul-long/2addr v5, v7

    iget-wide v7, p0, Lnet/oauth/SimpleOAuthValidator;->maxTimestampAgeMsec:J

    add-long/2addr v5, v7

    add-long/2addr v5, v9

    invoke-direct {v4, v5, v6}, Ljava/util/Date;-><init>(J)V

    goto :goto_1
.end method


# virtual methods
.method protected checkSingleParameters(Lnet/oauth/OAuthMessage;)V
    .locals 13
    .parameter "message"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;,
            Lnet/oauth/OAuthException;
        }
    .end annotation

    .prologue
    .line 154
    const/4 v8, 0x0

    .line 155
    .local v8, repeated:Z
    new-instance v3, Ljava/util/HashMap;

    invoke-direct {v3}, Ljava/util/HashMap;-><init>()V

    .line 156
    .local v3, nameToValues:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;Ljava/util/Collection<Ljava/lang/String;>;>;"
    invoke-virtual {p1}, Lnet/oauth/OAuthMessage;->getParameters()Ljava/util/List;

    move-result-object v11

    invoke-interface {v11}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v0

    .local v0, i$:Ljava/util/Iterator;
    :cond_0
    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v11

    if-eqz v11, :cond_2

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Ljava/util/Map$Entry;

    .line 157
    .local v5, parameter:Ljava/util/Map$Entry;,"Ljava/util/Map$Entry<Ljava/lang/String;Ljava/lang/String;>;"
    invoke-interface {v5}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/String;

    .line 158
    .local v2, name:Ljava/lang/String;
    sget-object v11, Lnet/oauth/SimpleOAuthValidator;->SINGLE_PARAMETERS:Ljava/util/Set;

    invoke-interface {v11, v2}, Ljava/util/Set;->contains(Ljava/lang/Object;)Z

    move-result v11

    if-eqz v11, :cond_0

    .line 159
    invoke-interface {v3, v2}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v10

    check-cast v10, Ljava/util/Collection;

    .line 160
    .local v10, values:Ljava/util/Collection;,"Ljava/util/Collection<Ljava/lang/String;>;"
    if-nez v10, :cond_1

    .line 161
    new-instance v10, Ljava/util/ArrayList;

    .end local v10           #values:Ljava/util/Collection;,"Ljava/util/Collection<Ljava/lang/String;>;"
    invoke-direct {v10}, Ljava/util/ArrayList;-><init>()V

    .line 162
    .restart local v10       #values:Ljava/util/Collection;,"Ljava/util/Collection<Ljava/lang/String;>;"
    invoke-interface {v3, v2, v10}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 166
    :goto_1
    invoke-interface {v5}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;

    move-result-object v11

    invoke-interface {v10, v11}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z

    goto :goto_0

    .line 164
    :cond_1
    const/4 v8, 0x1

    goto :goto_1

    .line 169
    .end local v2           #name:Ljava/lang/String;
    .end local v5           #parameter:Ljava/util/Map$Entry;,"Ljava/util/Map$Entry<Ljava/lang/String;Ljava/lang/String;>;"
    .end local v10           #values:Ljava/util/Collection;,"Ljava/util/Collection<Ljava/lang/String;>;"
    :cond_2
    if-eqz v8, :cond_5

    .line 170
    new-instance v7, Ljava/util/ArrayList;

    invoke-direct {v7}, Ljava/util/ArrayList;-><init>()V

    .line 171
    .local v7, rejected:Ljava/util/Collection;,"Ljava/util/Collection<Lnet/oauth/OAuth$Parameter;>;"
    invoke-interface {v3}, Ljava/util/Map;->entrySet()Ljava/util/Set;

    move-result-object v11

    invoke-interface {v11}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v0

    .end local v0           #i$:Ljava/util/Iterator;
    :cond_3
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v11

    if-eqz v11, :cond_4

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Ljava/util/Map$Entry;

    .line 172
    .local v4, p:Ljava/util/Map$Entry;,"Ljava/util/Map$Entry<Ljava/lang/String;Ljava/util/Collection<Ljava/lang/String;>;>;"
    invoke-interface {v4}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/String;

    .line 173
    .restart local v2       #name:Ljava/lang/String;
    invoke-interface {v4}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;

    move-result-object v10

    check-cast v10, Ljava/util/Collection;

    .line 174
    .restart local v10       #values:Ljava/util/Collection;,"Ljava/util/Collection<Ljava/lang/String;>;"
    invoke-interface {v10}, Ljava/util/Collection;->size()I

    move-result v11

    const/4 v12, 0x1

    if-le v11, v12, :cond_3

    .line 175
    invoke-interface {v10}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

    move-result-object v1

    .local v1, i$:Ljava/util/Iterator;
    :goto_2
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v11

    if-eqz v11, :cond_3

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v9

    check-cast v9, Ljava/lang/String;

    .line 176
    .local v9, value:Ljava/lang/String;
    new-instance v11, Lnet/oauth/OAuth$Parameter;

    invoke-direct {v11, v2, v9}, Lnet/oauth/OAuth$Parameter;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-interface {v7, v11}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z

    goto :goto_2

    .line 180
    .end local v1           #i$:Ljava/util/Iterator;
    .end local v2           #name:Ljava/lang/String;
    .end local v4           #p:Ljava/util/Map$Entry;,"Ljava/util/Map$Entry<Ljava/lang/String;Ljava/util/Collection<Ljava/lang/String;>;>;"
    .end local v9           #value:Ljava/lang/String;
    .end local v10           #values:Ljava/util/Collection;,"Ljava/util/Collection<Ljava/lang/String;>;"
    :cond_4
    new-instance v6, Lnet/oauth/OAuthProblemException;

    const-string v11, "parameter_rejected"

    invoke-direct {v6, v11}, Lnet/oauth/OAuthProblemException;-><init>(Ljava/lang/String;)V

    .line 181
    .local v6, problem:Lnet/oauth/OAuthProblemException;
    const-string v11, "oauth_parameters_rejected"

    invoke-static {v7}, Lnet/oauth/OAuth;->formEncode(Ljava/lang/Iterable;)Ljava/lang/String;

    move-result-object v12

    invoke-virtual {v6, v11, v12}, Lnet/oauth/OAuthProblemException;->setParameter(Ljava/lang/String;Ljava/lang/Object;)V

    .line 182
    throw v6

    .line 184
    .end local v6           #problem:Lnet/oauth/OAuthProblemException;
    .end local v7           #rejected:Ljava/util/Collection;,"Ljava/util/Collection<Lnet/oauth/OAuth$Parameter;>;"
    .restart local v0       #i$:Ljava/util/Iterator;
    :cond_5
    return-void
.end method

.method protected currentTimeMsec()J
    .locals 2

    .prologue
    .line 259
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    return-wide v0
.end method

.method public releaseGarbage()Ljava/util/Date;
    .locals 2

    .prologue
    .line 115
    invoke-virtual {p0}, Lnet/oauth/SimpleOAuthValidator;->currentTimeMsec()J

    move-result-wide v0

    invoke-direct {p0, v0, v1}, Lnet/oauth/SimpleOAuthValidator;->removeOldNonces(J)Ljava/util/Date;

    move-result-object v0

    return-object v0
.end method

.method public validateMessage(Lnet/oauth/OAuthMessage;Lnet/oauth/OAuthAccessor;)V
    .locals 0
    .parameter "message"
    .parameter "accessor"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lnet/oauth/OAuthException;,
            Ljava/io/IOException;,
            Ljava/net/URISyntaxException;
        }
    .end annotation

    .prologue
    .line 145
    invoke-virtual {p0, p1}, Lnet/oauth/SimpleOAuthValidator;->checkSingleParameters(Lnet/oauth/OAuthMessage;)V

    .line 146
    invoke-virtual {p0, p1}, Lnet/oauth/SimpleOAuthValidator;->validateVersion(Lnet/oauth/OAuthMessage;)V

    .line 147
    invoke-virtual {p0, p1}, Lnet/oauth/SimpleOAuthValidator;->validateTimestampAndNonce(Lnet/oauth/OAuthMessage;)V

    .line 148
    invoke-virtual {p0, p1, p2}, Lnet/oauth/SimpleOAuthValidator;->validateSignature(Lnet/oauth/OAuthMessage;Lnet/oauth/OAuthAccessor;)V

    .line 149
    return-void
.end method

.method protected validateNonce(Lnet/oauth/OAuthMessage;JJ)Ljava/util/Date;
    .locals 5
    .parameter "message"
    .parameter "timestamp"
    .parameter "currentTimeMsec"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;,
            Lnet/oauth/OAuthProblemException;
        }
    .end annotation

    .prologue
    .line 233
    new-instance v0, Lnet/oauth/SimpleOAuthValidator$UsedNonce;

    const/4 v2, 0x3

    new-array v2, v2, [Ljava/lang/String;

    const/4 v3, 0x0

    const-string v4, "oauth_nonce"

    invoke-virtual {p1, v4}, Lnet/oauth/OAuthMessage;->getParameter(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    aput-object v4, v2, v3

    const/4 v3, 0x1

    invoke-virtual {p1}, Lnet/oauth/OAuthMessage;->getConsumerKey()Ljava/lang/String;

    move-result-object v4

    aput-object v4, v2, v3

    const/4 v3, 0x2

    invoke-virtual {p1}, Lnet/oauth/OAuthMessage;->getToken()Ljava/lang/String;

    move-result-object v4

    aput-object v4, v2, v3

    invoke-direct {v0, p2, p3, v2}, Lnet/oauth/SimpleOAuthValidator$UsedNonce;-><init>(J[Ljava/lang/String;)V

    .line 240
    .local v0, nonce:Lnet/oauth/SimpleOAuthValidator$UsedNonce;
    const/4 v1, 0x0

    .line 241
    .local v1, valid:Z
    iget-object v3, p0, Lnet/oauth/SimpleOAuthValidator;->usedNonces:Ljava/util/Set;

    monitor-enter v3

    .line 242
    :try_start_0
    iget-object v2, p0, Lnet/oauth/SimpleOAuthValidator;->usedNonces:Ljava/util/Set;

    invoke-interface {v2, v0}, Ljava/util/Set;->add(Ljava/lang/Object;)Z

    move-result v1

    .line 243
    monitor-exit v3
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 244
    if-nez v1, :cond_0

    .line 245
    new-instance v2, Lnet/oauth/OAuthProblemException;

    const-string v3, "nonce_used"

    invoke-direct {v2, v3}, Lnet/oauth/OAuthProblemException;-><init>(Ljava/lang/String;)V

    throw v2

    .line 243
    :catchall_0
    move-exception v2

    :try_start_1
    monitor-exit v3
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    throw v2

    .line 247
    :cond_0
    invoke-direct {p0, p4, p5}, Lnet/oauth/SimpleOAuthValidator;->removeOldNonces(J)Ljava/util/Date;

    move-result-object v2

    return-object v2
.end method

.method protected validateSignature(Lnet/oauth/OAuthMessage;Lnet/oauth/OAuthAccessor;)V
    .locals 3
    .parameter "message"
    .parameter "accessor"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lnet/oauth/OAuthException;,
            Ljava/io/IOException;,
            Ljava/net/URISyntaxException;
        }
    .end annotation

    .prologue
    .line 252
    const/4 v0, 0x3

    new-array v0, v0, [Ljava/lang/String;

    const/4 v1, 0x0

    const-string v2, "oauth_consumer_key"

    aput-object v2, v0, v1

    const/4 v1, 0x1

    const-string v2, "oauth_signature_method"

    aput-object v2, v0, v1

    const/4 v1, 0x2

    const-string v2, "oauth_signature"

    aput-object v2, v0, v1

    invoke-virtual {p1, v0}, Lnet/oauth/OAuthMessage;->requireParameters([Ljava/lang/String;)V

    .line 254
    invoke-static {p1, p2}, Lnet/oauth/signature/OAuthSignatureMethod;->newSigner(Lnet/oauth/OAuthMessage;Lnet/oauth/OAuthAccessor;)Lnet/oauth/signature/OAuthSignatureMethod;

    move-result-object v0

    invoke-virtual {v0, p1}, Lnet/oauth/signature/OAuthSignatureMethod;->validate(Lnet/oauth/OAuthMessage;)V

    .line 255
    return-void
.end method

.method protected validateTimestamp(Lnet/oauth/OAuthMessage;JJ)V
    .locals 9
    .parameter "message"
    .parameter "timestamp"
    .parameter "currentTimeMsec"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;,
            Lnet/oauth/OAuthProblemException;
        }
    .end annotation

    .prologue
    .line 215
    iget-wide v5, p0, Lnet/oauth/SimpleOAuthValidator;->maxTimestampAgeMsec:J

    sub-long v5, p4, v5

    const-wide/16 v7, 0x1f4

    add-long/2addr v5, v7

    const-wide/16 v7, 0x3e8

    div-long v2, v5, v7

    .line 216
    .local v2, min:J
    iget-wide v5, p0, Lnet/oauth/SimpleOAuthValidator;->maxTimestampAgeMsec:J

    add-long/2addr v5, p4

    const-wide/16 v7, 0x1f4

    add-long/2addr v5, v7

    const-wide/16 v7, 0x3e8

    div-long v0, v5, v7

    .line 217
    .local v0, max:J
    cmp-long v5, p2, v2

    if-ltz v5, :cond_0

    cmp-long v5, v0, p2

    if-gez v5, :cond_1

    .line 218
    :cond_0
    new-instance v4, Lnet/oauth/OAuthProblemException;

    const-string v5, "timestamp_refused"

    invoke-direct {v4, v5}, Lnet/oauth/OAuthProblemException;-><init>(Ljava/lang/String;)V

    .line 219
    .local v4, problem:Lnet/oauth/OAuthProblemException;
    const-string v5, "oauth_acceptable_timestamps"

    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v6, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v6

    const-string v7, "-"

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6, v0, v1}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-virtual {v4, v5, v6}, Lnet/oauth/OAuthProblemException;->setParameter(Ljava/lang/String;Ljava/lang/Object;)V

    .line 220
    throw v4

    .line 222
    .end local v4           #problem:Lnet/oauth/OAuthProblemException;
    :cond_1
    return-void
.end method

.method protected validateTimestampAndNonce(Lnet/oauth/OAuthMessage;)V
    .locals 7
    .parameter "message"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;,
            Lnet/oauth/OAuthProblemException;
        }
    .end annotation

    .prologue
    .line 205
    const/4 v0, 0x2

    new-array v0, v0, [Ljava/lang/String;

    const/4 v1, 0x0

    const-string v6, "oauth_timestamp"

    aput-object v6, v0, v1

    const/4 v1, 0x1

    const-string v6, "oauth_nonce"

    aput-object v6, v0, v1

    invoke-virtual {p1, v0}, Lnet/oauth/OAuthMessage;->requireParameters([Ljava/lang/String;)V

    .line 206
    const-string v0, "oauth_timestamp"

    invoke-virtual {p1, v0}, Lnet/oauth/OAuthMessage;->getParameter(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J

    move-result-wide v2

    .line 207
    .local v2, timestamp:J
    invoke-virtual {p0}, Lnet/oauth/SimpleOAuthValidator;->currentTimeMsec()J

    move-result-wide v4

    .local v4, now:J
    move-object v0, p0

    move-object v1, p1

    .line 208
    invoke-virtual/range {v0 .. v5}, Lnet/oauth/SimpleOAuthValidator;->validateTimestamp(Lnet/oauth/OAuthMessage;JJ)V

    move-object v0, p0

    move-object v1, p1

    .line 209
    invoke-virtual/range {v0 .. v5}, Lnet/oauth/SimpleOAuthValidator;->validateNonce(Lnet/oauth/OAuthMessage;JJ)Ljava/util/Date;

    .line 210
    return-void
.end method

.method protected validateVersion(Lnet/oauth/OAuthMessage;)V
    .locals 8
    .parameter "message"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lnet/oauth/OAuthException;,
            Ljava/io/IOException;
        }
    .end annotation

    .prologue
    .line 188
    const-string v4, "oauth_version"

    invoke-virtual {p1, v4}, Lnet/oauth/OAuthMessage;->getParameter(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    .line 189
    .local v3, versionString:Ljava/lang/String;
    if-eqz v3, :cond_1

    .line 190
    invoke-static {v3}, Ljava/lang/Double;->parseDouble(Ljava/lang/String;)D

    move-result-wide v1

    .line 191
    .local v1, version:D
    const-wide/high16 v4, 0x3ff0

    cmpg-double v4, v1, v4

    if-ltz v4, :cond_0

    iget-wide v4, p0, Lnet/oauth/SimpleOAuthValidator;->maxVersion:D

    cmpg-double v4, v4, v1

    if-gez v4, :cond_1

    .line 192
    :cond_0
    new-instance v0, Lnet/oauth/OAuthProblemException;

    const-string v4, "version_rejected"

    invoke-direct {v0, v4}, Lnet/oauth/OAuthProblemException;-><init>(Ljava/lang/String;)V

    .line 193
    .local v0, problem:Lnet/oauth/OAuthProblemException;
    const-string v4, "oauth_acceptable_versions"

    new-instance v5, Ljava/lang/StringBuilder;

    invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V

    const-string v6, "1.0-"

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    iget-wide v6, p0, Lnet/oauth/SimpleOAuthValidator;->maxVersion:D

    invoke-virtual {v5, v6, v7}, Ljava/lang/StringBuilder;->append(D)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v0, v4, v5}, Lnet/oauth/OAuthProblemException;->setParameter(Ljava/lang/String;Ljava/lang/Object;)V

    .line 194
    throw v0

    .line 197
    .end local v0           #problem:Lnet/oauth/OAuthProblemException;
    .end local v1           #version:D
    :cond_1
    return-void
.end method
